@page
@using EasyAbp.EShop.Plugins.Baskets.Permissions
@using EasyAbp.EShop.Plugins.Baskets.Web.Pages.EShop.Plugins.Baskets.BasketItems.BasketItem
@using EasyAbp.EShop.Plugins.Baskets.Localization
@using EasyAbp.EShop.Plugins.Baskets.Web.Menus
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@model IndexModel
@inject IPageLayout PageLayout
@inject IHtmlLocalizer<BasketsResource> L
@inject IAuthorizationService Authorization
@{
    PageLayout.Content.Title = L["BasketItem"].Value;
    PageLayout.Content.BreadCrumb.Add(L["Menu:BasketItem"].Value);
    PageLayout.Content.MenuItemName = BasketsMenus.BasketItem;
}

@section scripts
{
    <abp-script src="/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/index.js" />
}
@section styles
{
    <abp-style src="/Pages/EShop/Plugins/Baskets/BasketItems/BasketItem/index.css"/>
}
<script>
    let basketName = '@Model.BasketName';
    let userId = '@Model.UserId';
</script>

<abp-card>
    <abp-card-header>
        <abp-row>
            <abp-column size-md="_6">
                <abp-card-title>@L["BasketItem"]</abp-card-title>
            </abp-column>
            <abp-column size-md="_6" class="text-right">
			    @if (await Authorization.IsGrantedAsync(BasketsPermissions.BasketItem.Create))
                { 
                <abp-button id="NewBasketItemButton"
                            text="@L["CreateBasketItem"].Value"
                            icon="plus"
                            button-type="Primary" />
                }
            </abp-column>
        </abp-row>
    </abp-card-header>
    <abp-card-body>
        <abp-table striped-rows="true" id="BasketItemTable" class="nowrap">
            <thead>
            <tr>
                <th>@L["Actions"]</th>
                <th>@L["BasketItemBasketName"]</th>
                <th>@L["BasketItemUserId"]</th>
                <th>@L["BasketItemStoreId"]</th>
                <th>@L["BasketItemProductId"]</th>
                <th>@L["BasketItemProductSkuId"]</th>
                <th>@L["BasketItemQuantity"]</th>
                <th>@L["BasketItemMediaResources"]</th>
                <th>@L["BasketItemProductUniqueName"]</th>
                <th>@L["BasketItemProductDisplayName"]</th>
                <th>@L["BasketItemSkuName"]</th>
                <th>@L["BasketItemSkuDescription"]</th>
                <th>@L["BasketItemCurrency"]</th>
                <th>@L["BasketItemUnitPrice"]</th>
                <th>@L["BasketItemTotalPrice"]</th>
                <th>@L["BasketItemTotalDiscount"]</th>
                <th>@L["BasketItemInventory"]</th>
                <th>@L["BasketItemIsInvalid"]</th>
            </tr>
            </thead>
        </abp-table>
    </abp-card-body>
</abp-card>